package com.card.hwatt.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "KQZ_Card")
public class Card {

	@Id
	@GeneratedValue(generator = "generator", strategy = GenerationType.AUTO)
	@GenericGenerator(name = "generator", strategy = "native")
	@Column(name = "CardID")
	public Long id;

	/**
	 * 录入日期
	 */
	@Column(name = "CardTime")
	public Date date;

	/**
	 * 员工
	 */
	@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
	@JoinColumn(name = "EmployeeID", nullable = false)
	public Employee employee;

	/**
	 * 特殊考勤
	 */
	@OneToOne(cascade = { CascadeType.ALL, CascadeType.REMOVE })
	@JoinColumn(name = "SpecialID")
	public Special special;

	@Column(name = "CardTypeID")
	public int cardTypeID = 0;

	@Column(name = "DevID")
	public int devID = 0;

	@Column(name = "DevClass")
	public int devClass = 0;

	@Column(name = "ImgID")
	public int imgID = 0;

	@Column(name = "ImgStatus")
	public int imgStatus = 1;

	@Column(name = "IsValidate")
	public int isValidate = 0;

	@Column(name = "ModifyUser")
	public int modifyUser = 0;

	@Column(name = "ModifyType")
	public int modifyType = 0;

	@Column(name = "FaceIDNo")
	public String faceIDNo = "";
}
